window.home = window.home || {};
home.Home = function () {
    var s = this;
    annie.Sprite.call(s);
    /*_a2x_need_start*/s.Hcont=null;/*_a2x_need_end*/
    annie.initRes(s, "home", "Home");
    var gamePage,
        listPage,
        homePage,
        allPage;
    s.addEventListener(annie.Event.ADD_TO_STAGE, function (e) {
        // userInfo.imageUrl = Base64.decode(GetQueryString('headimgurl'));
        // userInfo.name = Base64.decode(GetQueryString('nickname'));
        userInfo.openid =GetQueryString('openid');
        homePage = new pageOne.PageCont();
        s.Hcont.addChild(homePage)
    })

    annie.globalDispatcher.addEventListener("onChangeCont", function (e) {
        // console.log(e.data.cont);
        s.Hcont.removeAllChildren();
        if (e.data.cont == "gamePage") {
            gamePage = new airGam.GameCont();
            s.Hcont.addChild(gamePage);
        }
        else if (e.data.cont == "homePage") {
            if(homePage){
                homePage = new pageOne.PageCont();
            }
            s.Hcont.addChild(homePage)
        }
        else if (e.data.cont == "listPage") {
            listPage = new list.Ranking();
            s.Hcont.addChild(listPage);
        }
        else if (e.data.cont == "allList") {
            // console.log("jumpAll");
            allPage = new list.AllRanking();
            s.Hcont.addChild(allPage);
        }
    })
};
A2xExtend(home.Home, annie.Sprite);
